<template>
  <div>
    <el-card class="box-card">
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>订单金额:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{money}}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
            *
          </div>
        </el-col>
      </el-row>

      <p/>
      <el-button type="success" @click="login">购买</el-button>
    </el-card>

  </div>
</template>

<script>
export default {
  name: "addOrder",
  data() {
    return {
      money:'',
      valueMoney:'',
      value:'',
    }
  }
  ,
  methods: {
    init(money,value) {
      console.log(value)
      this.valueMoney=money;
      this.money=money+"元"
      this.value=value;
    },
    login(){
      this.$axios.get("meituan/meituan/addOrder/"+this.value.id+"/"+this.value.name+"/"+this.valueMoney).then(
          r=>{
            if (r.data=='添加订单成功'){
              this.$router.push("index")
              // location.href="/index"
            }
          }
      )
    }
  }
}
</script>

<style scoped>

</style>
